<?php
    require_once("core/functions.php");
    core::getResource("Controller.LoginController");
    session_start();


    if (isset($_REQUEST["lEmail"]) && isset($_REQUEST["lPassword"])) {
        $logEmail = $_REQUEST["lEmail"];
        $logPass = $_REQUEST["lPassword"];
        $logController = new LoginController($logEmail, $logPass);
        $result = $logController->tryLogin();
        if ($result == LOGIN_SUCCESS) {
            $_SESSION['personId'] = $logController->getId();
            core::redirect("vwall.php");
        } else {
            echo "ERROR : " . LOGIN_ERROR;
        }
    }
?>

<?php $title = "Timetable"; ?>
<?php include_once("header.php"); ?>
<div id="showCalendar">

</div>
<script type="text/javascript">
    var cal = null;

    window.onload = function(evt) {
        cal = new UTSDK.calendar(UTSDK.$("showCalendar"));
    };
</script>
<?php include_once("footer.php"); ?>